package cn.memset.user.autoconfigure;

import cn.memset.user.api.feign.UserFeignClient;
import cn.memset.user.api.feign.UserFeignMarker;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(UserFeignMarker.class) // 当用到了UserFeignMarker后配置类生效
@EnableFeignClients(basePackageClasses = UserFeignMarker.class)
@EnableConfigurationProperties(MsUserConfiguration.class) // @EnableConfigurationProperties 注解的作用是:让使用了 @ConfigurationProperties 注解的类生效,并且将该类注入到 IOC 容器中,交由 IOC 容器进行管理, 这里也就是把MsUserConfiguration注入到ioc中了
@Import({UserFeignClient.UserFallbackFactory.class})
public class MsUserAutoConfiguration {

}




